<template>
  <div class="Page-ranking">
    <E-ranking title="官方榜" :listData="officialList" />
    <E-ranking title="全球榜" :listData="elseList" />
  </div>
</template>

<script>
export default {
  components: {
    'E-ranking': () => import('./module/E-ranking')
  },
  mounted() {
    this.getData();
  },
  data() {
    return {
      officialList: [],
      artistToplist: {},
      elseList: []
    };
  },
  methods: {
    getData() {
      this.$api.get('reco_toplist', true).then((data) => {
        this.artistToplist = data.artistToplist || {};
        this.officialList = data.list.filter((item) => item.ToplistType);
        this.elseList = data.list.filter((item) => !item.ToplistType);
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.Page-ranking {
  padding: 20px;
}
</style>
